28/04/21 PH
Looking at high-res scans over resonance regions, with wavefunctions.
For
!hostname
!conda env list
import sys
import os
from pathlib import Path
import numpy as np
# import epsproc as ep
import xarray as xr
import matplotlib.pyplot as plt
from datetime import datetime as dt
timeString = dt.now()
# For module testing, include path to module here, otherwise use global installation
if sys.platform == "win32":
modPath = r'D:\code\github\ePSproc' # Win test machine
winFlag = True
else:
modPath = r'/home/femtolab/github/ePSproc/' # Linux test machine
winFlag = False
sys.path.append(modPath)
import epsproc as ep
# Plotters
from epsproc.plot import hvPlotters
# Multijob class dev code
from epsproc.classes.multiJob import ePSmultiJob
hvPlotters.setPlotters(width = 1000, snsStyle="whitegrid")
# import bokeh
# import holoviews as hv
# hv.extension('bokeh')
# For class, above settings don't take, not sure why, something to do with namespaces/calling sequence?
# Overriding snsStyle does work however... although NOT CONSISTENTLY????
# AH, looks like ordering matters - set_style LAST (.set seems to override)
import seaborn as sns
sns.set(rc={'figure.figsize':(10,6)}) # Set figure size in inches
sns.set_context("paper")
sns.set_style("whitegrid") # Set plot style
sns.set_palette("Paired") # Set colour mapping
# sns.set_theme(context='paper', style='whitegrid') # Not valid for v0.9.0
# Try direct fig type setting for PDF output figs
from IPython.display import set_matplotlib_formats
# set_matplotlib_formats('png', 'pdf')
set_matplotlib_formats('svg', 'pdf')
# # Scan for subdirs, based on existing routine in getFiles()
# fileBase = r'D:\projects\ePolyScat\xef2\XeF2_highRes_wf' # Data dir on Stimpy
# fileBase = r'D:\VMs\Share\ePSshare\xe\Xe_wf' # Data dir on Stimpy
# jobDirs = [r'D:\VMs\Share\ePSshare\xe\Xe_wf\orb19_4d'] # Check OK for single dir specified method
# Set explicit list of dirs
# jobDirs = [r'D:\VMs\Share\ePSshare\xe\Xe_wf\orb19_4d', r'D:\projects\ePolyScat\xef2\XeF2_highRes_wf\orb21_A1G',
# r'D:\projects\ePolyScat\xef2\XeF2_highRes_wf\orb22_E1G', r'D:\projects\ePolyScat\xef2\XeF2_highRes_wf\orb24_E2G']
# For single bond-length, res scan, on Stimpy
jobDirs = [r'D:\VMs\Share\ePSshare\xef2\XeF2_resscan\orb22_E1G-1.900']
data = ePSmultiJob(jobDirs = jobDirs, verbose = 0)
# keys = [4,5,6] # Set for 4d data only
# data.scanFiles(keys = keys)
data.scanFiles() # All files
data.jobsSummary()
High res scan at 0.25eV step-size, over 1st resonance feature and Cooper minimum region.
# Comparative plot over datasets (all symmetries only)
Etype = 'Eke' # Set for Eke or Ehv energy scale
Erange=[0, 100] # Plot range (full range if not passed to function below)
data.plotGetCroComp(pType='SIGMA', Etype = Etype, Erange = Erange)
# data.plotGetCroComp(pType='SIGMA', Etype = Etype)
# Comparative plot over datasets (all symmetries only)
# Etype = 'Ehv' # Set for Eke or Ehv energy scale
# Erange=[50, 300] # Plot range (full range if not passed to function below)
data.plotGetCroComp(pType='BETA', Etype = Etype, Erange = Erange)
# data.plotGetCroComp(pType='SIGMA', Etype = Etype)
High-res over resonance regions. For overview & more discussion, see notes at https://phockett.github.io/ePSdata/XeF2-preliminary/xe-xef2_plots-notes_220421.html#Matrix-elements.
# Set options - should be in structure!
thres = 0.01
logFlag = True
selDims = {'Type':'L', 'it':1}
figSize = (15,8)
cmap = "vlag"
data.lmPlot(dataType = 'matE', Erange = Erange, Etype = Etype, thres = thres, logFlag = logFlag, selDims = selDims, fillna = True, cmap = cmap, figsize = figSize)
# cmap = "cubehelix" ) # Quite good for showing resonance features.
data.lmPlot(dataType = 'matE', pType = "phase", Erange = Erange, Etype = Etype, thres = thres, logFlag = False, selDims = selDims, fillna = True, cmap = cmap, figsize = figSize)
# cmap = "cubehelix" ) # Quite good for showing resonance features.
# Load class and data
from epsproc.vol.wfPlot import wfPlotter
# Load data from modPath\data
dataPath = os.path.join(jobDirs[0], 'waveFn')
tempdir = Path(r'D:\temp\xef2_wavefn_280421')
wfClass = wfPlotter(fileBase = dataPath, tempdir = tempdir)
# Run for DU case, first resonance only (ugly index selection only at the moment!)
wfClass.selectOrbFiles(EList = list(range(0,75)), SymList = 'SPUCDU')
# Read files...
wfClass.readOrbFiles()
wfClass.tempdir = tempdir
# Generate animation...
# Generate animation...
# Currently need to force some options for animation case... UGLY!!!
wfClass.plotOptions['global']['subplot'] = True
wfClass.plotOptions['global']['animate'] = True
wfClass.plotOptions['global']['interactive'] = False
wfClass.plotOptions['global']['isoLevels'] = 6
wfClass.plotOptions['global']['opacity'] = 0.5
# wfClass.plotOptions['global']['isoValsPC'] = [0.25, 0.5]
# wfClass.plotOptions['global']['isoValsAbs'] = [-0.01559873, 0.01559873] # This is currently what is set by default, bit low in this case
# wfClass.plotOptions['global']['isoValsAbs'] = [-0.1, 0.1] # OK
# wfClass.plotOptions['global']['isoValsAbs'] = [-0.2, -0.1, 0.1, 0.2] # OK
wfClass.plotOptions['global']['isoValsAbs'] = [-0.2, -0.1, -0.05, 0.05, 0.1, 0.2] # OK
wfClass.plotWf(pType='Re')
# wfClass.plotWf(pType='Abs')